{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Yes\n"
     ]
    }
   ],
   "source": [
    "print('Yes')"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "终于安装成功啦"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Ok,I can do it!\n"
     ]
    }
   ],
   "source": [
    "print('Ok,I can do it!')"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "尝试修改一下"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "push\n"
     ]
    }
   ],
   "source": [
    "print('push')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [],
   "source": [
    "import pandas as pd   #"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [],
   "source": [
    "import numpy as np   #"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Day</th>\n",
       "      <th>Preclose</th>\n",
       "      <th>Open</th>\n",
       "      <th>Highest</th>\n",
       "      <th>Lowest</th>\n",
       "      <th>Close</th>\n",
       "      <th>Volume</th>\n",
       "      <th>Money</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>1990/12/19</td>\n",
       "      <td></td>\n",
       "      <td>96.0500</td>\n",
       "      <td>99.9800</td>\n",
       "      <td>95.7900</td>\n",
       "      <td>99.9800</td>\n",
       "      <td>126000</td>\n",
       "      <td>4.940000e+05</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>1990/12/20</td>\n",
       "      <td>99.98</td>\n",
       "      <td>104.3000</td>\n",
       "      <td>104.3900</td>\n",
       "      <td>99.9800</td>\n",
       "      <td>104.3900</td>\n",
       "      <td>19700</td>\n",
       "      <td>8.400000e+04</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>1990/12/21</td>\n",
       "      <td>104.39</td>\n",
       "      <td>109.0700</td>\n",
       "      <td>109.1300</td>\n",
       "      <td>103.7300</td>\n",
       "      <td>109.1300</td>\n",
       "      <td>2800</td>\n",
       "      <td>1.600000e+04</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>1990/12/24</td>\n",
       "      <td>109.13</td>\n",
       "      <td>113.5700</td>\n",
       "      <td>114.5500</td>\n",
       "      <td>109.1300</td>\n",
       "      <td>114.5500</td>\n",
       "      <td>3200</td>\n",
       "      <td>3.100000e+04</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>1990/12/25</td>\n",
       "      <td>114.55</td>\n",
       "      <td>120.0900</td>\n",
       "      <td>120.2500</td>\n",
       "      <td>114.5500</td>\n",
       "      <td>120.2500</td>\n",
       "      <td>1500</td>\n",
       "      <td>6.000000e+03</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8205</th>\n",
       "      <td>2024/7/25</td>\n",
       "      <td>2901.9518</td>\n",
       "      <td>2891.8918</td>\n",
       "      <td>2897.7674</td>\n",
       "      <td>2872.8497</td>\n",
       "      <td>2886.7416</td>\n",
       "      <td>27463950000</td>\n",
       "      <td>2.732820e+11</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8206</th>\n",
       "      <td>2024/7/26</td>\n",
       "      <td>2886.7416</td>\n",
       "      <td>2885.9953</td>\n",
       "      <td>2899.1162</td>\n",
       "      <td>2875.3959</td>\n",
       "      <td>2890.8973</td>\n",
       "      <td>27838753600</td>\n",
       "      <td>2.754430e+11</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8207</th>\n",
       "      <td>2024/7/29</td>\n",
       "      <td>2890.8973</td>\n",
       "      <td>2889.4726</td>\n",
       "      <td>2898.9512</td>\n",
       "      <td>2878.5825</td>\n",
       "      <td>2891.8453</td>\n",
       "      <td>25689972700</td>\n",
       "      <td>2.600950e+11</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8208</th>\n",
       "      <td>2024/7/30</td>\n",
       "      <td>2891.8453</td>\n",
       "      <td>2885.2152</td>\n",
       "      <td>2885.2152</td>\n",
       "      <td>2865.1493</td>\n",
       "      <td>2879.2996</td>\n",
       "      <td>26247883700</td>\n",
       "      <td>2.694770e+11</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8209</th>\n",
       "      <td>2024/7/31</td>\n",
       "      <td>2879.2996</td>\n",
       "      <td>2877.5409</td>\n",
       "      <td>2940.5927</td>\n",
       "      <td>2876.3009</td>\n",
       "      <td>2938.7493</td>\n",
       "      <td>41272341700</td>\n",
       "      <td>4.188720e+11</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>8210 rows × 8 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "             Day   Preclose       Open    Highest     Lowest      Close  \\\n",
       "0     1990/12/19               96.0500    99.9800    95.7900    99.9800   \n",
       "1     1990/12/20      99.98   104.3000   104.3900    99.9800   104.3900   \n",
       "2     1990/12/21     104.39   109.0700   109.1300   103.7300   109.1300   \n",
       "3     1990/12/24     109.13   113.5700   114.5500   109.1300   114.5500   \n",
       "4     1990/12/25     114.55   120.0900   120.2500   114.5500   120.2500   \n",
       "...          ...        ...        ...        ...        ...        ...   \n",
       "8205   2024/7/25  2901.9518  2891.8918  2897.7674  2872.8497  2886.7416   \n",
       "8206   2024/7/26  2886.7416  2885.9953  2899.1162  2875.3959  2890.8973   \n",
       "8207   2024/7/29  2890.8973  2889.4726  2898.9512  2878.5825  2891.8453   \n",
       "8208   2024/7/30  2891.8453  2885.2152  2885.2152  2865.1493  2879.2996   \n",
       "8209   2024/7/31  2879.2996  2877.5409  2940.5927  2876.3009  2938.7493   \n",
       "\n",
       "           Volume         Money  \n",
       "0          126000  4.940000e+05  \n",
       "1           19700  8.400000e+04  \n",
       "2            2800  1.600000e+04  \n",
       "3            3200  3.100000e+04  \n",
       "4            1500  6.000000e+03  \n",
       "...           ...           ...  \n",
       "8205  27463950000  2.732820e+11  \n",
       "8206  27838753600  2.754430e+11  \n",
       "8207  25689972700  2.600950e+11  \n",
       "8208  26247883700  2.694770e+11  \n",
       "8209  41272341700  4.188720e+11  \n",
       "\n",
       "[8210 rows x 8 columns]"
      ]
     },
     "execution_count": 7,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "data=pd.read_csv('000001.csv')  #重命名数据名称\n",
    "data#显示数据"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [],
   "source": [
    "#备注"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'大段注释'"
      ]
     },
     "execution_count": 9,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "'''大段注释'''"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'数据切片'"
      ]
     },
     "execution_count": 10,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "'''数据切片'''"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0       1990/12/19\n",
       "1       1990/12/20\n",
       "2       1990/12/21\n",
       "3       1990/12/24\n",
       "4       1990/12/25\n",
       "           ...    \n",
       "8205     2024/7/25\n",
       "8206     2024/7/26\n",
       "8207     2024/7/29\n",
       "8208     2024/7/30\n",
       "8209     2024/7/31\n",
       "Name: Day, Length: 8210, dtype: object"
      ]
     },
     "execution_count": 11,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "data['Day']#选取一个目标（列）"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {},
   "outputs": [
    {
     "ename": "NameError",
     "evalue": "name 'date' is not defined",
     "output_type": "error",
     "traceback": [
      "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[1;31mNameError\u001b[0m                                 Traceback (most recent call last)",
      "Cell \u001b[1;32mIn[12], line 1\u001b[0m\n\u001b[1;32m----> 1\u001b[0m date[[\u001b[38;5;124m'\u001b[39m\u001b[38;5;124mDay\u001b[39m\u001b[38;5;124m'\u001b[39m]]\n",
      "\u001b[1;31mNameError\u001b[0m: name 'date' is not defined"
     ]
    }
   ],
   "source": [
    "date[['Day']]#输出格式为数据框，且可选择多个目标（列）"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 59,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "type"
      ]
     },
     "execution_count": 59,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "type#显示数据格式"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 60,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Day</th>\n",
       "      <th>Preclose</th>\n",
       "      <th>Open</th>\n",
       "      <th>Highest</th>\n",
       "      <th>Lowest</th>\n",
       "      <th>Close</th>\n",
       "      <th>Volume</th>\n",
       "      <th>Money</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>1990/12/19</td>\n",
       "      <td></td>\n",
       "      <td>96.05</td>\n",
       "      <td>99.98</td>\n",
       "      <td>95.79</td>\n",
       "      <td>99.98</td>\n",
       "      <td>126000</td>\n",
       "      <td>494000.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>1990/12/20</td>\n",
       "      <td>99.98</td>\n",
       "      <td>104.30</td>\n",
       "      <td>104.39</td>\n",
       "      <td>99.98</td>\n",
       "      <td>104.39</td>\n",
       "      <td>19700</td>\n",
       "      <td>84000.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>1990/12/21</td>\n",
       "      <td>104.39</td>\n",
       "      <td>109.07</td>\n",
       "      <td>109.13</td>\n",
       "      <td>103.73</td>\n",
       "      <td>109.13</td>\n",
       "      <td>2800</td>\n",
       "      <td>16000.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>1990/12/24</td>\n",
       "      <td>109.13</td>\n",
       "      <td>113.57</td>\n",
       "      <td>114.55</td>\n",
       "      <td>109.13</td>\n",
       "      <td>114.55</td>\n",
       "      <td>3200</td>\n",
       "      <td>31000.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>1990/12/25</td>\n",
       "      <td>114.55</td>\n",
       "      <td>120.09</td>\n",
       "      <td>120.25</td>\n",
       "      <td>114.55</td>\n",
       "      <td>120.25</td>\n",
       "      <td>1500</td>\n",
       "      <td>6000.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>1990/12/26</td>\n",
       "      <td>120.25</td>\n",
       "      <td>125.27</td>\n",
       "      <td>125.27</td>\n",
       "      <td>120.25</td>\n",
       "      <td>125.27</td>\n",
       "      <td>10000</td>\n",
       "      <td>53000.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>1990/12/27</td>\n",
       "      <td>125.27</td>\n",
       "      <td>125.27</td>\n",
       "      <td>125.28</td>\n",
       "      <td>125.27</td>\n",
       "      <td>125.28</td>\n",
       "      <td>6600</td>\n",
       "      <td>104000.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>1990/12/28</td>\n",
       "      <td>125.28</td>\n",
       "      <td>126.39</td>\n",
       "      <td>126.45</td>\n",
       "      <td>125.28</td>\n",
       "      <td>126.45</td>\n",
       "      <td>10800</td>\n",
       "      <td>88000.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>1990/12/31</td>\n",
       "      <td>126.45</td>\n",
       "      <td>126.56</td>\n",
       "      <td>127.61</td>\n",
       "      <td>126.48</td>\n",
       "      <td>127.61</td>\n",
       "      <td>7800</td>\n",
       "      <td>60000.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>1991/1/2</td>\n",
       "      <td>127.61</td>\n",
       "      <td>127.61</td>\n",
       "      <td>128.84</td>\n",
       "      <td>127.61</td>\n",
       "      <td>128.84</td>\n",
       "      <td>9100</td>\n",
       "      <td>59000.0</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "          Day  Preclose    Open  Highest  Lowest   Close  Volume     Money\n",
       "0  1990/12/19             96.05    99.98   95.79   99.98  126000  494000.0\n",
       "1  1990/12/20     99.98  104.30   104.39   99.98  104.39   19700   84000.0\n",
       "2  1990/12/21    104.39  109.07   109.13  103.73  109.13    2800   16000.0\n",
       "3  1990/12/24    109.13  113.57   114.55  109.13  114.55    3200   31000.0\n",
       "4  1990/12/25    114.55  120.09   120.25  114.55  120.25    1500    6000.0\n",
       "5  1990/12/26    120.25  125.27   125.27  120.25  125.27   10000   53000.0\n",
       "6  1990/12/27    125.27  125.27   125.28  125.27  125.28    6600  104000.0\n",
       "7  1990/12/28    125.28  126.39   126.45  125.28  126.45   10800   88000.0\n",
       "8  1990/12/31    126.45  126.56   127.61  126.48  127.61    7800   60000.0\n",
       "9    1991/1/2    127.61  127.61   128.84  127.61  128.84    9100   59000.0"
      ]
     },
     "execution_count": 60,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "data[0:10]#选取第0行到第10行"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 61,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Day</th>\n",
       "      <th>Preclose</th>\n",
       "      <th>Open</th>\n",
       "      <th>Highest</th>\n",
       "      <th>Lowest</th>\n",
       "      <th>Close</th>\n",
       "      <th>Volume</th>\n",
       "      <th>Money</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>8207</th>\n",
       "      <td>2024/7/29</td>\n",
       "      <td>2890.8973</td>\n",
       "      <td>2889.4726</td>\n",
       "      <td>2898.9512</td>\n",
       "      <td>2878.5825</td>\n",
       "      <td>2891.8453</td>\n",
       "      <td>25689972700</td>\n",
       "      <td>2.600950e+11</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "            Day   Preclose       Open    Highest     Lowest      Close  \\\n",
       "8207  2024/7/29  2890.8973  2889.4726  2898.9512  2878.5825  2891.8453   \n",
       "\n",
       "           Volume         Money  \n",
       "8207  25689972700  2.600950e+11  "
      ]
     },
     "execution_count": 61,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "data[data['Day']=='2024/7/29']#选取指定行"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 62,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Day</th>\n",
       "      <th>Preclose</th>\n",
       "      <th>Open</th>\n",
       "      <th>Highest</th>\n",
       "      <th>Lowest</th>\n",
       "      <th>Close</th>\n",
       "      <th>Volume</th>\n",
       "      <th>Money</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>1990/12/19</td>\n",
       "      <td></td>\n",
       "      <td>96.0500</td>\n",
       "      <td>99.9800</td>\n",
       "      <td>95.7900</td>\n",
       "      <td>99.9800</td>\n",
       "      <td>126000</td>\n",
       "      <td>4.940000e+05</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>1990/12/20</td>\n",
       "      <td>99.98</td>\n",
       "      <td>104.3000</td>\n",
       "      <td>104.3900</td>\n",
       "      <td>99.9800</td>\n",
       "      <td>104.3900</td>\n",
       "      <td>19700</td>\n",
       "      <td>8.400000e+04</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>1990/12/21</td>\n",
       "      <td>104.39</td>\n",
       "      <td>109.0700</td>\n",
       "      <td>109.1300</td>\n",
       "      <td>103.7300</td>\n",
       "      <td>109.1300</td>\n",
       "      <td>2800</td>\n",
       "      <td>1.600000e+04</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>1990/12/24</td>\n",
       "      <td>109.13</td>\n",
       "      <td>113.5700</td>\n",
       "      <td>114.5500</td>\n",
       "      <td>109.1300</td>\n",
       "      <td>114.5500</td>\n",
       "      <td>3200</td>\n",
       "      <td>3.100000e+04</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>1990/12/25</td>\n",
       "      <td>114.55</td>\n",
       "      <td>120.0900</td>\n",
       "      <td>120.2500</td>\n",
       "      <td>114.5500</td>\n",
       "      <td>120.2500</td>\n",
       "      <td>1500</td>\n",
       "      <td>6.000000e+03</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8205</th>\n",
       "      <td>2024/7/25</td>\n",
       "      <td>2901.9518</td>\n",
       "      <td>2891.8918</td>\n",
       "      <td>2897.7674</td>\n",
       "      <td>2872.8497</td>\n",
       "      <td>2886.7416</td>\n",
       "      <td>27463950000</td>\n",
       "      <td>2.732820e+11</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8206</th>\n",
       "      <td>2024/7/26</td>\n",
       "      <td>2886.7416</td>\n",
       "      <td>2885.9953</td>\n",
       "      <td>2899.1162</td>\n",
       "      <td>2875.3959</td>\n",
       "      <td>2890.8973</td>\n",
       "      <td>27838753600</td>\n",
       "      <td>2.754430e+11</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8207</th>\n",
       "      <td>2024/7/29</td>\n",
       "      <td>2890.8973</td>\n",
       "      <td>2889.4726</td>\n",
       "      <td>2898.9512</td>\n",
       "      <td>2878.5825</td>\n",
       "      <td>2891.8453</td>\n",
       "      <td>25689972700</td>\n",
       "      <td>2.600950e+11</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8208</th>\n",
       "      <td>2024/7/30</td>\n",
       "      <td>2891.8453</td>\n",
       "      <td>2885.2152</td>\n",
       "      <td>2885.2152</td>\n",
       "      <td>2865.1493</td>\n",
       "      <td>2879.2996</td>\n",
       "      <td>26247883700</td>\n",
       "      <td>2.694770e+11</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8209</th>\n",
       "      <td>2024/7/31</td>\n",
       "      <td>2879.2996</td>\n",
       "      <td>2877.5409</td>\n",
       "      <td>2940.5927</td>\n",
       "      <td>2876.3009</td>\n",
       "      <td>2938.7493</td>\n",
       "      <td>41272341700</td>\n",
       "      <td>4.188720e+11</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>8210 rows × 8 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "             Day   Preclose       Open    Highest     Lowest      Close  \\\n",
       "0     1990/12/19               96.0500    99.9800    95.7900    99.9800   \n",
       "1     1990/12/20      99.98   104.3000   104.3900    99.9800   104.3900   \n",
       "2     1990/12/21     104.39   109.0700   109.1300   103.7300   109.1300   \n",
       "3     1990/12/24     109.13   113.5700   114.5500   109.1300   114.5500   \n",
       "4     1990/12/25     114.55   120.0900   120.2500   114.5500   120.2500   \n",
       "...          ...        ...        ...        ...        ...        ...   \n",
       "8205   2024/7/25  2901.9518  2891.8918  2897.7674  2872.8497  2886.7416   \n",
       "8206   2024/7/26  2886.7416  2885.9953  2899.1162  2875.3959  2890.8973   \n",
       "8207   2024/7/29  2890.8973  2889.4726  2898.9512  2878.5825  2891.8453   \n",
       "8208   2024/7/30  2891.8453  2885.2152  2885.2152  2865.1493  2879.2996   \n",
       "8209   2024/7/31  2879.2996  2877.5409  2940.5927  2876.3009  2938.7493   \n",
       "\n",
       "           Volume         Money  \n",
       "0          126000  4.940000e+05  \n",
       "1           19700  8.400000e+04  \n",
       "2            2800  1.600000e+04  \n",
       "3            3200  3.100000e+04  \n",
       "4            1500  6.000000e+03  \n",
       "...           ...           ...  \n",
       "8205  27463950000  2.732820e+11  \n",
       "8206  27838753600  2.754430e+11  \n",
       "8207  25689972700  2.600950e+11  \n",
       "8208  26247883700  2.694770e+11  \n",
       "8209  41272341700  4.188720e+11  \n",
       "\n",
       "[8210 rows x 8 columns]"
      ]
     },
     "execution_count": 62,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "data=pd.read_csv('000001.csv')  #重命名数据名称\n",
    "data"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 63,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Day</th>\n",
       "      <th>Preclose</th>\n",
       "      <th>Open</th>\n",
       "      <th>Highest</th>\n",
       "      <th>Lowest</th>\n",
       "      <th>Close</th>\n",
       "      <th>Volume</th>\n",
       "      <th>Money</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>1990-12-19</td>\n",
       "      <td></td>\n",
       "      <td>96.0500</td>\n",
       "      <td>99.9800</td>\n",
       "      <td>95.7900</td>\n",
       "      <td>99.9800</td>\n",
       "      <td>126000</td>\n",
       "      <td>4.940000e+05</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>1990-12-20</td>\n",
       "      <td>99.98</td>\n",
       "      <td>104.3000</td>\n",
       "      <td>104.3900</td>\n",
       "      <td>99.9800</td>\n",
       "      <td>104.3900</td>\n",
       "      <td>19700</td>\n",
       "      <td>8.400000e+04</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>1990-12-21</td>\n",
       "      <td>104.39</td>\n",
       "      <td>109.0700</td>\n",
       "      <td>109.1300</td>\n",
       "      <td>103.7300</td>\n",
       "      <td>109.1300</td>\n",
       "      <td>2800</td>\n",
       "      <td>1.600000e+04</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>1990-12-24</td>\n",
       "      <td>109.13</td>\n",
       "      <td>113.5700</td>\n",
       "      <td>114.5500</td>\n",
       "      <td>109.1300</td>\n",
       "      <td>114.5500</td>\n",
       "      <td>3200</td>\n",
       "      <td>3.100000e+04</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>1990-12-25</td>\n",
       "      <td>114.55</td>\n",
       "      <td>120.0900</td>\n",
       "      <td>120.2500</td>\n",
       "      <td>114.5500</td>\n",
       "      <td>120.2500</td>\n",
       "      <td>1500</td>\n",
       "      <td>6.000000e+03</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8205</th>\n",
       "      <td>2024-07-25</td>\n",
       "      <td>2901.9518</td>\n",
       "      <td>2891.8918</td>\n",
       "      <td>2897.7674</td>\n",
       "      <td>2872.8497</td>\n",
       "      <td>2886.7416</td>\n",
       "      <td>27463950000</td>\n",
       "      <td>2.732820e+11</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8206</th>\n",
       "      <td>2024-07-26</td>\n",
       "      <td>2886.7416</td>\n",
       "      <td>2885.9953</td>\n",
       "      <td>2899.1162</td>\n",
       "      <td>2875.3959</td>\n",
       "      <td>2890.8973</td>\n",
       "      <td>27838753600</td>\n",
       "      <td>2.754430e+11</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8207</th>\n",
       "      <td>2024-07-29</td>\n",
       "      <td>2890.8973</td>\n",
       "      <td>2889.4726</td>\n",
       "      <td>2898.9512</td>\n",
       "      <td>2878.5825</td>\n",
       "      <td>2891.8453</td>\n",
       "      <td>25689972700</td>\n",
       "      <td>2.600950e+11</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8208</th>\n",
       "      <td>2024-07-30</td>\n",
       "      <td>2891.8453</td>\n",
       "      <td>2885.2152</td>\n",
       "      <td>2885.2152</td>\n",
       "      <td>2865.1493</td>\n",
       "      <td>2879.2996</td>\n",
       "      <td>26247883700</td>\n",
       "      <td>2.694770e+11</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8209</th>\n",
       "      <td>2024-07-31</td>\n",
       "      <td>2879.2996</td>\n",
       "      <td>2877.5409</td>\n",
       "      <td>2940.5927</td>\n",
       "      <td>2876.3009</td>\n",
       "      <td>2938.7493</td>\n",
       "      <td>41272341700</td>\n",
       "      <td>4.188720e+11</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>8210 rows × 8 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "            Day   Preclose       Open    Highest     Lowest      Close  \\\n",
       "0    1990-12-19               96.0500    99.9800    95.7900    99.9800   \n",
       "1    1990-12-20      99.98   104.3000   104.3900    99.9800   104.3900   \n",
       "2    1990-12-21     104.39   109.0700   109.1300   103.7300   109.1300   \n",
       "3    1990-12-24     109.13   113.5700   114.5500   109.1300   114.5500   \n",
       "4    1990-12-25     114.55   120.0900   120.2500   114.5500   120.2500   \n",
       "...         ...        ...        ...        ...        ...        ...   \n",
       "8205 2024-07-25  2901.9518  2891.8918  2897.7674  2872.8497  2886.7416   \n",
       "8206 2024-07-26  2886.7416  2885.9953  2899.1162  2875.3959  2890.8973   \n",
       "8207 2024-07-29  2890.8973  2889.4726  2898.9512  2878.5825  2891.8453   \n",
       "8208 2024-07-30  2891.8453  2885.2152  2885.2152  2865.1493  2879.2996   \n",
       "8209 2024-07-31  2879.2996  2877.5409  2940.5927  2876.3009  2938.7493   \n",
       "\n",
       "           Volume         Money  \n",
       "0          126000  4.940000e+05  \n",
       "1           19700  8.400000e+04  \n",
       "2            2800  1.600000e+04  \n",
       "3            3200  3.100000e+04  \n",
       "4            1500  6.000000e+03  \n",
       "...           ...           ...  \n",
       "8205  27463950000  2.732820e+11  \n",
       "8206  27838753600  2.754430e+11  \n",
       "8207  25689972700  2.600950e+11  \n",
       "8208  26247883700  2.694770e+11  \n",
       "8209  41272341700  4.188720e+11  \n",
       "\n",
       "[8210 rows x 8 columns]"
      ]
     },
     "execution_count": 63,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "data['Day']=pd.to_datetime(data['Day'],format='%Y/%m/%d')#将Day列转为日期格式\n",
    "data"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 64,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Day</th>\n",
       "      <th>Preclose</th>\n",
       "      <th>Open</th>\n",
       "      <th>Highest</th>\n",
       "      <th>Lowest</th>\n",
       "      <th>Close</th>\n",
       "      <th>Volume</th>\n",
       "      <th>Money</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>1990-12-19</td>\n",
       "      <td></td>\n",
       "      <td>96.0500</td>\n",
       "      <td>99.9800</td>\n",
       "      <td>95.7900</td>\n",
       "      <td>99.9800</td>\n",
       "      <td>126000</td>\n",
       "      <td>4.940000e+05</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>1990-12-20</td>\n",
       "      <td>99.98</td>\n",
       "      <td>104.3000</td>\n",
       "      <td>104.3900</td>\n",
       "      <td>99.9800</td>\n",
       "      <td>104.3900</td>\n",
       "      <td>19700</td>\n",
       "      <td>8.400000e+04</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>1990-12-21</td>\n",
       "      <td>104.39</td>\n",
       "      <td>109.0700</td>\n",
       "      <td>109.1300</td>\n",
       "      <td>103.7300</td>\n",
       "      <td>109.1300</td>\n",
       "      <td>2800</td>\n",
       "      <td>1.600000e+04</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>1990-12-24</td>\n",
       "      <td>109.13</td>\n",
       "      <td>113.5700</td>\n",
       "      <td>114.5500</td>\n",
       "      <td>109.1300</td>\n",
       "      <td>114.5500</td>\n",
       "      <td>3200</td>\n",
       "      <td>3.100000e+04</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>1990-12-25</td>\n",
       "      <td>114.55</td>\n",
       "      <td>120.0900</td>\n",
       "      <td>120.2500</td>\n",
       "      <td>114.5500</td>\n",
       "      <td>120.2500</td>\n",
       "      <td>1500</td>\n",
       "      <td>6.000000e+03</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8205</th>\n",
       "      <td>2024-07-25</td>\n",
       "      <td>2901.9518</td>\n",
       "      <td>2891.8918</td>\n",
       "      <td>2897.7674</td>\n",
       "      <td>2872.8497</td>\n",
       "      <td>2886.7416</td>\n",
       "      <td>27463950000</td>\n",
       "      <td>2.732820e+11</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8206</th>\n",
       "      <td>2024-07-26</td>\n",
       "      <td>2886.7416</td>\n",
       "      <td>2885.9953</td>\n",
       "      <td>2899.1162</td>\n",
       "      <td>2875.3959</td>\n",
       "      <td>2890.8973</td>\n",
       "      <td>27838753600</td>\n",
       "      <td>2.754430e+11</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8207</th>\n",
       "      <td>2024-07-29</td>\n",
       "      <td>2890.8973</td>\n",
       "      <td>2889.4726</td>\n",
       "      <td>2898.9512</td>\n",
       "      <td>2878.5825</td>\n",
       "      <td>2891.8453</td>\n",
       "      <td>25689972700</td>\n",
       "      <td>2.600950e+11</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8208</th>\n",
       "      <td>2024-07-30</td>\n",
       "      <td>2891.8453</td>\n",
       "      <td>2885.2152</td>\n",
       "      <td>2885.2152</td>\n",
       "      <td>2865.1493</td>\n",
       "      <td>2879.2996</td>\n",
       "      <td>26247883700</td>\n",
       "      <td>2.694770e+11</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8209</th>\n",
       "      <td>2024-07-31</td>\n",
       "      <td>2879.2996</td>\n",
       "      <td>2877.5409</td>\n",
       "      <td>2940.5927</td>\n",
       "      <td>2876.3009</td>\n",
       "      <td>2938.7493</td>\n",
       "      <td>41272341700</td>\n",
       "      <td>4.188720e+11</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>8210 rows × 8 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "            Day   Preclose       Open    Highest     Lowest      Close  \\\n",
       "0    1990-12-19               96.0500    99.9800    95.7900    99.9800   \n",
       "1    1990-12-20      99.98   104.3000   104.3900    99.9800   104.3900   \n",
       "2    1990-12-21     104.39   109.0700   109.1300   103.7300   109.1300   \n",
       "3    1990-12-24     109.13   113.5700   114.5500   109.1300   114.5500   \n",
       "4    1990-12-25     114.55   120.0900   120.2500   114.5500   120.2500   \n",
       "...         ...        ...        ...        ...        ...        ...   \n",
       "8205 2024-07-25  2901.9518  2891.8918  2897.7674  2872.8497  2886.7416   \n",
       "8206 2024-07-26  2886.7416  2885.9953  2899.1162  2875.3959  2890.8973   \n",
       "8207 2024-07-29  2890.8973  2889.4726  2898.9512  2878.5825  2891.8453   \n",
       "8208 2024-07-30  2891.8453  2885.2152  2885.2152  2865.1493  2879.2996   \n",
       "8209 2024-07-31  2879.2996  2877.5409  2940.5927  2876.3009  2938.7493   \n",
       "\n",
       "           Volume         Money  \n",
       "0          126000  4.940000e+05  \n",
       "1           19700  8.400000e+04  \n",
       "2            2800  1.600000e+04  \n",
       "3            3200  3.100000e+04  \n",
       "4            1500  6.000000e+03  \n",
       "...           ...           ...  \n",
       "8205  27463950000  2.732820e+11  \n",
       "8206  27838753600  2.754430e+11  \n",
       "8207  25689972700  2.600950e+11  \n",
       "8208  26247883700  2.694770e+11  \n",
       "8209  41272341700  4.188720e+11  \n",
       "\n",
       "[8210 rows x 8 columns]"
      ]
     },
     "execution_count": 64,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "data=data.sort_values(by='Day',ascending=True)#sort_values为排序函数，对时间进行排序True为升序，False为降序\n",
    "data"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 65,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Preclose</th>\n",
       "      <th>Open</th>\n",
       "      <th>Highest</th>\n",
       "      <th>Lowest</th>\n",
       "      <th>Close</th>\n",
       "      <th>Volume</th>\n",
       "      <th>Money</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Day</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>1990-12-19</th>\n",
       "      <td></td>\n",
       "      <td>96.0500</td>\n",
       "      <td>99.9800</td>\n",
       "      <td>95.7900</td>\n",
       "      <td>99.9800</td>\n",
       "      <td>126000</td>\n",
       "      <td>4.940000e+05</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1990-12-20</th>\n",
       "      <td>99.98</td>\n",
       "      <td>104.3000</td>\n",
       "      <td>104.3900</td>\n",
       "      <td>99.9800</td>\n",
       "      <td>104.3900</td>\n",
       "      <td>19700</td>\n",
       "      <td>8.400000e+04</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1990-12-21</th>\n",
       "      <td>104.39</td>\n",
       "      <td>109.0700</td>\n",
       "      <td>109.1300</td>\n",
       "      <td>103.7300</td>\n",
       "      <td>109.1300</td>\n",
       "      <td>2800</td>\n",
       "      <td>1.600000e+04</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1990-12-24</th>\n",
       "      <td>109.13</td>\n",
       "      <td>113.5700</td>\n",
       "      <td>114.5500</td>\n",
       "      <td>109.1300</td>\n",
       "      <td>114.5500</td>\n",
       "      <td>3200</td>\n",
       "      <td>3.100000e+04</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1990-12-25</th>\n",
       "      <td>114.55</td>\n",
       "      <td>120.0900</td>\n",
       "      <td>120.2500</td>\n",
       "      <td>114.5500</td>\n",
       "      <td>120.2500</td>\n",
       "      <td>1500</td>\n",
       "      <td>6.000000e+03</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2024-07-25</th>\n",
       "      <td>2901.9518</td>\n",
       "      <td>2891.8918</td>\n",
       "      <td>2897.7674</td>\n",
       "      <td>2872.8497</td>\n",
       "      <td>2886.7416</td>\n",
       "      <td>27463950000</td>\n",
       "      <td>2.732820e+11</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2024-07-26</th>\n",
       "      <td>2886.7416</td>\n",
       "      <td>2885.9953</td>\n",
       "      <td>2899.1162</td>\n",
       "      <td>2875.3959</td>\n",
       "      <td>2890.8973</td>\n",
       "      <td>27838753600</td>\n",
       "      <td>2.754430e+11</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2024-07-29</th>\n",
       "      <td>2890.8973</td>\n",
       "      <td>2889.4726</td>\n",
       "      <td>2898.9512</td>\n",
       "      <td>2878.5825</td>\n",
       "      <td>2891.8453</td>\n",
       "      <td>25689972700</td>\n",
       "      <td>2.600950e+11</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2024-07-30</th>\n",
       "      <td>2891.8453</td>\n",
       "      <td>2885.2152</td>\n",
       "      <td>2885.2152</td>\n",
       "      <td>2865.1493</td>\n",
       "      <td>2879.2996</td>\n",
       "      <td>26247883700</td>\n",
       "      <td>2.694770e+11</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2024-07-31</th>\n",
       "      <td>2879.2996</td>\n",
       "      <td>2877.5409</td>\n",
       "      <td>2940.5927</td>\n",
       "      <td>2876.3009</td>\n",
       "      <td>2938.7493</td>\n",
       "      <td>41272341700</td>\n",
       "      <td>4.188720e+11</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>8210 rows × 7 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "             Preclose       Open    Highest     Lowest      Close  \\\n",
       "Day                                                                 \n",
       "1990-12-19               96.0500    99.9800    95.7900    99.9800   \n",
       "1990-12-20      99.98   104.3000   104.3900    99.9800   104.3900   \n",
       "1990-12-21     104.39   109.0700   109.1300   103.7300   109.1300   \n",
       "1990-12-24     109.13   113.5700   114.5500   109.1300   114.5500   \n",
       "1990-12-25     114.55   120.0900   120.2500   114.5500   120.2500   \n",
       "...               ...        ...        ...        ...        ...   \n",
       "2024-07-25  2901.9518  2891.8918  2897.7674  2872.8497  2886.7416   \n",
       "2024-07-26  2886.7416  2885.9953  2899.1162  2875.3959  2890.8973   \n",
       "2024-07-29  2890.8973  2889.4726  2898.9512  2878.5825  2891.8453   \n",
       "2024-07-30  2891.8453  2885.2152  2885.2152  2865.1493  2879.2996   \n",
       "2024-07-31  2879.2996  2877.5409  2940.5927  2876.3009  2938.7493   \n",
       "\n",
       "                 Volume         Money  \n",
       "Day                                    \n",
       "1990-12-19       126000  4.940000e+05  \n",
       "1990-12-20        19700  8.400000e+04  \n",
       "1990-12-21         2800  1.600000e+04  \n",
       "1990-12-24         3200  3.100000e+04  \n",
       "1990-12-25         1500  6.000000e+03  \n",
       "...                 ...           ...  \n",
       "2024-07-25  27463950000  2.732820e+11  \n",
       "2024-07-26  27838753600  2.754430e+11  \n",
       "2024-07-29  25689972700  2.600950e+11  \n",
       "2024-07-30  26247883700  2.694770e+11  \n",
       "2024-07-31  41272341700  4.188720e+11  \n",
       "\n",
       "[8210 rows x 7 columns]"
      ]
     },
     "execution_count": 65,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "data.set_index('Day',inplace=True)#设置索引\n",
    "data"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 66,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Preclose</th>\n",
       "      <th>Open</th>\n",
       "      <th>Highest</th>\n",
       "      <th>Lowest</th>\n",
       "      <th>Close</th>\n",
       "      <th>Volume</th>\n",
       "      <th>Money</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Day</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>2000-01-04</th>\n",
       "      <td>1366.58</td>\n",
       "      <td>1368.69</td>\n",
       "      <td>1407.52</td>\n",
       "      <td>1361.21</td>\n",
       "      <td>1406.37</td>\n",
       "      <td>903282400</td>\n",
       "      <td>5.801142e+09</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2000-01-05</th>\n",
       "      <td>1406.37</td>\n",
       "      <td>1407.83</td>\n",
       "      <td>1433.78</td>\n",
       "      <td>1398.32</td>\n",
       "      <td>1409.68</td>\n",
       "      <td>1057939200</td>\n",
       "      <td>8.652696e+09</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2000-01-06</th>\n",
       "      <td>1409.68</td>\n",
       "      <td>1406.04</td>\n",
       "      <td>1463.95</td>\n",
       "      <td>1400.25</td>\n",
       "      <td>1463.94</td>\n",
       "      <td>1348051700</td>\n",
       "      <td>1.023807e+10</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2000-01-07</th>\n",
       "      <td>1463.94</td>\n",
       "      <td>1477.15</td>\n",
       "      <td>1522.83</td>\n",
       "      <td>1477.15</td>\n",
       "      <td>1516.60</td>\n",
       "      <td>3486939600</td>\n",
       "      <td>2.207351e+10</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2000-01-10</th>\n",
       "      <td>1516.6</td>\n",
       "      <td>1531.71</td>\n",
       "      <td>1546.72</td>\n",
       "      <td>1506.40</td>\n",
       "      <td>1545.11</td>\n",
       "      <td>3125304600</td>\n",
       "      <td>2.092877e+10</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2000-01-11</th>\n",
       "      <td>1545.11</td>\n",
       "      <td>1547.68</td>\n",
       "      <td>1547.71</td>\n",
       "      <td>1468.76</td>\n",
       "      <td>1479.78</td>\n",
       "      <td>2192456800</td>\n",
       "      <td>1.701122e+10</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2000-01-12</th>\n",
       "      <td>1479.78</td>\n",
       "      <td>1473.76</td>\n",
       "      <td>1489.28</td>\n",
       "      <td>1435.00</td>\n",
       "      <td>1438.02</td>\n",
       "      <td>1522193400</td>\n",
       "      <td>1.335989e+10</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2000-01-13</th>\n",
       "      <td>1438.02</td>\n",
       "      <td>1437.45</td>\n",
       "      <td>1444.07</td>\n",
       "      <td>1418.81</td>\n",
       "      <td>1424.44</td>\n",
       "      <td>861194300</td>\n",
       "      <td>7.797347e+09</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2000-01-14</th>\n",
       "      <td>1424.44</td>\n",
       "      <td>1426.22</td>\n",
       "      <td>1433.47</td>\n",
       "      <td>1401.71</td>\n",
       "      <td>1408.85</td>\n",
       "      <td>744701300</td>\n",
       "      <td>6.558865e+09</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2000-01-17</th>\n",
       "      <td>1408.85</td>\n",
       "      <td>1408.99</td>\n",
       "      <td>1433.38</td>\n",
       "      <td>1402.66</td>\n",
       "      <td>1433.33</td>\n",
       "      <td>764797700</td>\n",
       "      <td>6.608526e+09</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2000-01-18</th>\n",
       "      <td>1433.33</td>\n",
       "      <td>1436.89</td>\n",
       "      <td>1443.59</td>\n",
       "      <td>1421.64</td>\n",
       "      <td>1426.62</td>\n",
       "      <td>776713100</td>\n",
       "      <td>7.318323e+09</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2000-01-19</th>\n",
       "      <td>1426.62</td>\n",
       "      <td>1425.87</td>\n",
       "      <td>1443.67</td>\n",
       "      <td>1425.14</td>\n",
       "      <td>1440.72</td>\n",
       "      <td>800479300</td>\n",
       "      <td>6.845388e+09</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2000-01-20</th>\n",
       "      <td>1440.72</td>\n",
       "      <td>1443.09</td>\n",
       "      <td>1466.90</td>\n",
       "      <td>1443.09</td>\n",
       "      <td>1466.86</td>\n",
       "      <td>1007080300</td>\n",
       "      <td>9.274223e+09</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2000-01-21</th>\n",
       "      <td>1466.86</td>\n",
       "      <td>1471.90</td>\n",
       "      <td>1476.46</td>\n",
       "      <td>1458.92</td>\n",
       "      <td>1465.09</td>\n",
       "      <td>1505077200</td>\n",
       "      <td>1.436162e+10</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2000-01-24</th>\n",
       "      <td>1465.09</td>\n",
       "      <td>1465.86</td>\n",
       "      <td>1477.41</td>\n",
       "      <td>1449.47</td>\n",
       "      <td>1477.34</td>\n",
       "      <td>1624150800</td>\n",
       "      <td>1.535392e+10</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2000-01-25</th>\n",
       "      <td>1477.34</td>\n",
       "      <td>1483.03</td>\n",
       "      <td>1490.46</td>\n",
       "      <td>1467.44</td>\n",
       "      <td>1476.51</td>\n",
       "      <td>1363598300</td>\n",
       "      <td>1.349232e+10</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2000-01-26</th>\n",
       "      <td>1476.51</td>\n",
       "      <td>1477.30</td>\n",
       "      <td>1482.46</td>\n",
       "      <td>1469.98</td>\n",
       "      <td>1481.12</td>\n",
       "      <td>1038443800</td>\n",
       "      <td>9.989914e+09</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2000-01-27</th>\n",
       "      <td>1481.12</td>\n",
       "      <td>1490.45</td>\n",
       "      <td>1506.92</td>\n",
       "      <td>1485.23</td>\n",
       "      <td>1506.77</td>\n",
       "      <td>1897997400</td>\n",
       "      <td>1.694332e+10</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2000-01-28</th>\n",
       "      <td>1506.77</td>\n",
       "      <td>1514.56</td>\n",
       "      <td>1536.35</td>\n",
       "      <td>1510.74</td>\n",
       "      <td>1535.00</td>\n",
       "      <td>2938816200</td>\n",
       "      <td>2.254731e+10</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2000-02-14</th>\n",
       "      <td>1535</td>\n",
       "      <td>1591.44</td>\n",
       "      <td>1674.13</td>\n",
       "      <td>1587.82</td>\n",
       "      <td>1673.94</td>\n",
       "      <td>4356913200</td>\n",
       "      <td>2.657836e+10</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2000-02-15</th>\n",
       "      <td>1673.94</td>\n",
       "      <td>1709.22</td>\n",
       "      <td>1746.44</td>\n",
       "      <td>1663.01</td>\n",
       "      <td>1670.67</td>\n",
       "      <td>5254342800</td>\n",
       "      <td>3.893162e+10</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2000-02-16</th>\n",
       "      <td>1670.67</td>\n",
       "      <td>1674.94</td>\n",
       "      <td>1695.88</td>\n",
       "      <td>1649.70</td>\n",
       "      <td>1693.11</td>\n",
       "      <td>3743554800</td>\n",
       "      <td>3.600922e+10</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2000-02-17</th>\n",
       "      <td>1693.11</td>\n",
       "      <td>1734.27</td>\n",
       "      <td>1770.88</td>\n",
       "      <td>1615.63</td>\n",
       "      <td>1640.65</td>\n",
       "      <td>5143906800</td>\n",
       "      <td>4.991312e+10</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2000-02-18</th>\n",
       "      <td>1640.65</td>\n",
       "      <td>1623.96</td>\n",
       "      <td>1668.16</td>\n",
       "      <td>1583.58</td>\n",
       "      <td>1668.09</td>\n",
       "      <td>2678535400</td>\n",
       "      <td>2.699147e+10</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2000-02-21</th>\n",
       "      <td>1668.09</td>\n",
       "      <td>1681.36</td>\n",
       "      <td>1697.01</td>\n",
       "      <td>1652.48</td>\n",
       "      <td>1677.14</td>\n",
       "      <td>3101120600</td>\n",
       "      <td>3.384525e+10</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2000-02-22</th>\n",
       "      <td>1677.14</td>\n",
       "      <td>1681.30</td>\n",
       "      <td>1687.51</td>\n",
       "      <td>1627.47</td>\n",
       "      <td>1632.29</td>\n",
       "      <td>2425177600</td>\n",
       "      <td>2.708358e+10</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2000-02-23</th>\n",
       "      <td>1632.29</td>\n",
       "      <td>1618.01</td>\n",
       "      <td>1630.55</td>\n",
       "      <td>1586.63</td>\n",
       "      <td>1594.93</td>\n",
       "      <td>1918573000</td>\n",
       "      <td>1.941863e+10</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2000-02-24</th>\n",
       "      <td>1594.93</td>\n",
       "      <td>1593.95</td>\n",
       "      <td>1634.32</td>\n",
       "      <td>1593.93</td>\n",
       "      <td>1634.31</td>\n",
       "      <td>1393287600</td>\n",
       "      <td>1.527216e+10</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2000-02-25</th>\n",
       "      <td>1634.31</td>\n",
       "      <td>1639.92</td>\n",
       "      <td>1650.37</td>\n",
       "      <td>1618.18</td>\n",
       "      <td>1631.58</td>\n",
       "      <td>1705805400</td>\n",
       "      <td>1.915268e+10</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2000-02-28</th>\n",
       "      <td>1631.58</td>\n",
       "      <td>1639.80</td>\n",
       "      <td>1704.88</td>\n",
       "      <td>1639.70</td>\n",
       "      <td>1704.86</td>\n",
       "      <td>2612794600</td>\n",
       "      <td>2.583602e+10</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2000-02-29</th>\n",
       "      <td>1704.86</td>\n",
       "      <td>1728.14</td>\n",
       "      <td>1733.14</td>\n",
       "      <td>1678.35</td>\n",
       "      <td>1714.58</td>\n",
       "      <td>2867874800</td>\n",
       "      <td>3.328588e+10</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "           Preclose     Open  Highest   Lowest    Close      Volume  \\\n",
       "Day                                                                   \n",
       "2000-01-04  1366.58  1368.69  1407.52  1361.21  1406.37   903282400   \n",
       "2000-01-05  1406.37  1407.83  1433.78  1398.32  1409.68  1057939200   \n",
       "2000-01-06  1409.68  1406.04  1463.95  1400.25  1463.94  1348051700   \n",
       "2000-01-07  1463.94  1477.15  1522.83  1477.15  1516.60  3486939600   \n",
       "2000-01-10   1516.6  1531.71  1546.72  1506.40  1545.11  3125304600   \n",
       "2000-01-11  1545.11  1547.68  1547.71  1468.76  1479.78  2192456800   \n",
       "2000-01-12  1479.78  1473.76  1489.28  1435.00  1438.02  1522193400   \n",
       "2000-01-13  1438.02  1437.45  1444.07  1418.81  1424.44   861194300   \n",
       "2000-01-14  1424.44  1426.22  1433.47  1401.71  1408.85   744701300   \n",
       "2000-01-17  1408.85  1408.99  1433.38  1402.66  1433.33   764797700   \n",
       "2000-01-18  1433.33  1436.89  1443.59  1421.64  1426.62   776713100   \n",
       "2000-01-19  1426.62  1425.87  1443.67  1425.14  1440.72   800479300   \n",
       "2000-01-20  1440.72  1443.09  1466.90  1443.09  1466.86  1007080300   \n",
       "2000-01-21  1466.86  1471.90  1476.46  1458.92  1465.09  1505077200   \n",
       "2000-01-24  1465.09  1465.86  1477.41  1449.47  1477.34  1624150800   \n",
       "2000-01-25  1477.34  1483.03  1490.46  1467.44  1476.51  1363598300   \n",
       "2000-01-26  1476.51  1477.30  1482.46  1469.98  1481.12  1038443800   \n",
       "2000-01-27  1481.12  1490.45  1506.92  1485.23  1506.77  1897997400   \n",
       "2000-01-28  1506.77  1514.56  1536.35  1510.74  1535.00  2938816200   \n",
       "2000-02-14     1535  1591.44  1674.13  1587.82  1673.94  4356913200   \n",
       "2000-02-15  1673.94  1709.22  1746.44  1663.01  1670.67  5254342800   \n",
       "2000-02-16  1670.67  1674.94  1695.88  1649.70  1693.11  3743554800   \n",
       "2000-02-17  1693.11  1734.27  1770.88  1615.63  1640.65  5143906800   \n",
       "2000-02-18  1640.65  1623.96  1668.16  1583.58  1668.09  2678535400   \n",
       "2000-02-21  1668.09  1681.36  1697.01  1652.48  1677.14  3101120600   \n",
       "2000-02-22  1677.14  1681.30  1687.51  1627.47  1632.29  2425177600   \n",
       "2000-02-23  1632.29  1618.01  1630.55  1586.63  1594.93  1918573000   \n",
       "2000-02-24  1594.93  1593.95  1634.32  1593.93  1634.31  1393287600   \n",
       "2000-02-25  1634.31  1639.92  1650.37  1618.18  1631.58  1705805400   \n",
       "2000-02-28  1631.58  1639.80  1704.88  1639.70  1704.86  2612794600   \n",
       "2000-02-29  1704.86  1728.14  1733.14  1678.35  1714.58  2867874800   \n",
       "\n",
       "                   Money  \n",
       "Day                       \n",
       "2000-01-04  5.801142e+09  \n",
       "2000-01-05  8.652696e+09  \n",
       "2000-01-06  1.023807e+10  \n",
       "2000-01-07  2.207351e+10  \n",
       "2000-01-10  2.092877e+10  \n",
       "2000-01-11  1.701122e+10  \n",
       "2000-01-12  1.335989e+10  \n",
       "2000-01-13  7.797347e+09  \n",
       "2000-01-14  6.558865e+09  \n",
       "2000-01-17  6.608526e+09  \n",
       "2000-01-18  7.318323e+09  \n",
       "2000-01-19  6.845388e+09  \n",
       "2000-01-20  9.274223e+09  \n",
       "2000-01-21  1.436162e+10  \n",
       "2000-01-24  1.535392e+10  \n",
       "2000-01-25  1.349232e+10  \n",
       "2000-01-26  9.989914e+09  \n",
       "2000-01-27  1.694332e+10  \n",
       "2000-01-28  2.254731e+10  \n",
       "2000-02-14  2.657836e+10  \n",
       "2000-02-15  3.893162e+10  \n",
       "2000-02-16  3.600922e+10  \n",
       "2000-02-17  4.991312e+10  \n",
       "2000-02-18  2.699147e+10  \n",
       "2000-02-21  3.384525e+10  \n",
       "2000-02-22  2.708358e+10  \n",
       "2000-02-23  1.941863e+10  \n",
       "2000-02-24  1.527216e+10  \n",
       "2000-02-25  1.915268e+10  \n",
       "2000-02-28  2.583602e+10  \n",
       "2000-02-29  3.328588e+10  "
      ]
     },
     "execution_count": 66,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "data['2000-01':'2000-02']#已设置索引，查找指定时间段数据"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "'''1。尽量不用价格进行预测，更注重股票收益率。\n",
    "2.股指、IPO首日首月首年的波动不具有普适性，往往不考虑\n",
    "3.尽量避免在Python中使用'''"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [
    {
     "ename": "NameError",
     "evalue": "name 'pd' is not defined",
     "output_type": "error",
     "traceback": [
      "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[1;31mNameError\u001b[0m                                 Traceback (most recent call last)",
      "Cell \u001b[1;32mIn[1], line 1\u001b[0m\n\u001b[1;32m----> 1\u001b[0m data[\u001b[38;5;124m'\u001b[39m\u001b[38;5;124mClose\u001b[39m\u001b[38;5;124m'\u001b[39m]\u001b[38;5;241m=\u001b[39mpd\u001b[38;5;241m.\u001b[39mto_numeric(data[\u001b[38;5;124m'\u001b[39m\u001b[38;5;124mClose\u001b[39m\u001b[38;5;124m'\u001b[39m])\n",
      "\u001b[1;31mNameError\u001b[0m: name 'pd' is not defined"
     ]
    }
   ],
   "source": [
    "data['Close']=pd.to_numeric(data['Close']) #第一次课程结束"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "base",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.13.5"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
